<template>
	<div>
		<Row>
			<Col class="p-1" :xs="24" :sm="24" :md="12" :lg="8" :xl="6" :xxl="4">
			<Input class="w-100" v-model="searchKey" placeholder="请输入会员类型名称" />
			</Col>
		</Row>
		<Row>
			<div class="w-100 d-flex justify-content-end align-items-center ">
				<Button class="m-1" type="primary" shape="circle" @click="searchs" icon="ios-search">查询</Button>
			</div>
		</Row>
		<div v-if="this.tableInfo.data.length == 0" class="d-flex justify-content-center p-1">
			暂无数据
		</div>
		<div v-else>
		<div class="mt-1">
			<Row>
				<Col class="p-1" v-for="(row, index) in tableInfo.data" :xs="24" :sm="24" :md="12" :lg="8" :xl="6"
					:xxl="6">
				<div class="text-xss rounded shadow overflow-hidden">
					<div class="p-2 bg-black-80 text-fuguang d-flex text-lg justify-content-start text-blod">
						<span>{{row.hlname}}</span>
					</div>
					<div class="p-2 bg-black-50 text-fuguang d-flex justify-content-end">
						<span>{{row.hylxid}}</span>
					</div>
					<div class="p-2 bg-black-50 position-relative  d-flex justify-content-between align-items-center">
						<div class="w-25  position-relative">
							<div class="padding-top-100"></div>
							<div class="position-absolute rounded-circle overflow-hidden top0">
								<img class="w-100 h-100" :src="row.jcover"/>
							</div>
							<div class="text-danhong text-center">{{row.jlname}}</div>
						</div>
						<div class="w-75 text-danhong ">
							
							    <div class="p-2 d-flex align-items-center justify-content-end">
							        <span class="text-danhong text-lg text-blod">￥{{row.amount / 100}}</span>
							    </div>
							
							<div class="p-2 d-flex align-items-center justify-content-end">
								<div class="text-fuguang">
									<span class="iconfont icon-paidui pl-1">{{row.zq}}天</span>
									<span class="iconfont icon-min pl-1">{{row.cs}}次</span>
									
									<div class="p-2 d-flex align-items-center justify-content-end">
										<span v-if="row.flg" class="text-danhong  text-blod ">启用</span>
										<span v-else class="text-danhong  text-blod ">禁用</span>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="p-1 bg-black-50 d-flex justify-content-end">
						<Button class="text-xss ml-2" type="primary" size="small" @click="show(row.kcid)">详细</Button>
		
					</div>
				</div>
				</Col>
			</Row>
		</div>
		</div>
		<div>
			<Page class="text-right mt-3" :page-size="tableInfo.pageSize" @on-change="pageSearch"
				:total="tableInfo.total" />
		</div>
	</div>
</template>
<script>
	export default {
		data: function() {
			return {
				searchKey: "",
				tableInfo: {
					currentPage: 1,
					pageSize: 12,
					total: 0,
					data: []
				}
			}
		},
		methods: {
			init: function() {
				this.tableInfo.currentPage = 0;
				this.search();
			},
			show: function(hylxid) {
				this.$router.push({
					path: "/hylx/detail?id=" + hylxid
				})
			},
			searchs: function() {
				this.tableInfo.currentPage = 1;
				this.search();
			},
			search: function() {
				this.http.get({
					url: "/client/hylx/page",
					param: {
						// 传一个当前页
						current : this.tableInfo.currentPage,
						size : this.tableInfo.pageSize,		
						searchKey : this.searchKey
					}
				}).then(data => {
					console.log(data)
					this.tableInfo.data = data.ahylx.records;
					this.tableInfo.currentPage = data.current;
					this.tableInfo.total = data.total;
					this.tableInfo.pageSize = data.size;
				});
			},
			pageSearch: function(changedPage) {
				this.tableInfo.currentPage = changedPage;
				this.search();
			}
		},
		created: function() {
			this.init();
		}
	}
</script>

<style>

</style>